package com.qys.livesMall.shop.controller.sys;

import com.qys.livesMall.app.user.model.dto.sys.SysHomeStatisticsDTO;
import com.qys.livesMall.app.user.model.vo.sys.SysHomeStatisticsVO;
import com.qys.livesMall.shop.modal.vo.ShopDailyDataVO;
import com.qys.livesMall.app.user.model.vo.sys.SysHomeTodayStatisticsVO;
import com.qys.livesMall.shop.service.SysHomeStatisticsService;
import com.qys.livesMall.common.result.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@RestController
@RequestMapping("/sysHomeStatistics")
@Tag(name = "sys-首页统计", description = "首页统计")
public class SysHomeStatisticsController {

    private final SysHomeStatisticsService sysHomeStatisticsService;

    @PostMapping("/info")
    public R<SysHomeStatisticsVO> info(@RequestBody SysHomeStatisticsDTO dto) {
        return R.ok(this.sysHomeStatisticsService.info(dto));
    }

    /**
     * 今天用户数据统计
     * @return
     */
    @PostMapping("/todayInfo")
    public R<SysHomeTodayStatisticsVO> todayInfo(@RequestParam("userSysType") Integer userSysType) {
        return R.ok(this.sysHomeStatisticsService.todayInfo(userSysType));
    }

    @GetMapping("/data/shop")
    @Operation(description = "店铺信息统计")
    public R<ShopDailyDataVO> getShopDailyData(){
        return R.ok(sysHomeStatisticsService.getShopDailyData());
    }
}
